Priority

enum Priority : ProtocolMessageEnum

The priority of this message for sending.
Higher priorities are sent first (when managing the transmit queue).
This field is never sent over the air, it is only used internally inside of a local device node.
API clients (either on the local node or connected directly to the node)
can set this parameter if necessary.
(values must be <= 127 to keep protobuf field to one byte in size.
Detailed background on this field:
I noticed a funny side effect of lora being so slow: Usually when making
a protocol there isn’t much need to use message priority to change the order
of transmission (because interfaces are fairly fast).
But for lora where packets can take a few seconds each, it is very important
to make sure that critical packets are sent ASAP.
In the case of meshtastic that means we want to send protocol acks as soon as possible
(to prevent unneeded retransmissions), we want routing messages to be sent next,
then messages marked as reliable and finally 'background' packets like periodic position updates.
So I bit the bullet and implemented a new (internal - not sent over the air)
field in MeshPacket called 'priority'.
And the transmission queue in the router object is now a priority queue.
Protobuf enum meshtastic.MeshPacket.Priority

Entries

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Properties

Link copied to clipboard
val ACK_VALUE: Int = 120

Ack/naks are sent with very high priority to ensure that retransmission
stops as soon as possible
ACK = 120;
Link copied to clipboard
val ALERT_VALUE: Int = 110

Higher priority alert message used for critical alerts which take priority over other reliable packets.
ALERT = 110;
Link copied to clipboard

Background position updates are sent with very low priority -
if the link is super congested they might not go out at all
BACKGROUND = 10;
Link copied to clipboard
val DEFAULT_VALUE: Int = 64

This priority is used for most messages that don't have a priority set
DEFAULT = 64;
Link copied to clipboard
val HIGH_VALUE: Int = 100

Higher priority for specific message types (portnums) to distinguish between other reliable packets.
HIGH = 100;
Link copied to clipboard
val MAX_VALUE: Int = 127

TODO: REPLACE
MAX = 127;
Link copied to clipboard
val MIN_VALUE: Int = 1

TODO: REPLACE
MIN = 1;
Link copied to clipboard

If priority is unset but the message is marked as want_ack,
assume it is important and use a slightly higher priority
RELIABLE = 70;
Link copied to clipboard

If priority is unset but the packet is a response to a request, we want it to get there relatively quickly.
Furthermore, responses stop relaying packets directed to a node early.
RESPONSE = 80;
Link copied to clipboard
val UNSET_VALUE: Int = 0

Treated as Priority.DEFAULT
UNSET = 0;

Functions

Link copied to clipboard
Link copied to clipboard
open fun getDescriptor(): Descriptors.EnumDescriptor
Link copied to clipboard
fun getDescriptorForType(): Descriptors.EnumDescriptor
Link copied to clipboard
fun getNumber(): Int
Link copied to clipboard
fun getValueDescriptor(): Descriptors.EnumValueDescriptor
Link copied to clipboard
open fun internalGetValueMap(): Internal.EnumLiteMap<MeshProtos.MeshPacket.Priority>
Link copied to clipboard
open fun valueOf(desc: Descriptors.EnumValueDescriptor): MeshProtos.MeshPacket.Priority

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.